
import http from '@/utils/request'

// /日志
export const addHealthLog = (params) => {
    return http({
      url: '/api/guwen/addHealthLog',
      method: 'post',
      data: params
    })
  }
  // 图片上传
  export const upFiles = (params) => {
    return http({
      url: '/api/Patient/base64_file',
      method: 'post',
      data: params
    })
  }
  // export const upFiles = (params) => {
  //   var form = new FormData()
  
  //   function isArray(o) {
  //     return Object.prototype.toString.call(o) == '[object Array]';
  //   }
  //   if (isArray(params)) {
  //     params.forEach(item => {
  //       form.append('file[]', item.file)
  //     });
  //   } else {
  //     form.append('file[]', params.file)
  //   }
  //   // form.append('file[]', arr)
  //   // console.log(params.file)
  //   return http({
  //     url: '/api/Patient/upFiles',
  //     method: 'post',
  //     data: form,
  //     config: 'formData'
  //   })
  // }
  export const addMedia = (params) => {
    return http({
      url: '/api/upFiles/addMedia',
      method: 'post',
      data: params,
    })
  }
  export const getFood = (params) => {
    return http({
      url: 'api/Patient/getFood',
      method: 'post',
      data: params,
    })
  }
  export const getOptionsClass = (params) => {
    return http({
      url: 'api/patient/getOptionsClass',
      method: 'post',
      data: params,
    })
  }
  export const getHealthLogLine = (params) => {
    return http({
      url: 'api/general/health_log',
      method: 'post',
      data: params,
    })
  }
  
  export const getHealthLog = (params) => {
    return http({
      url: '/api/guwen/getHealthLog',
      method: 'post',
      data: params,
    })
  }